public class Factory {
    public Fruit CreateFruit(String kind) {
        switch(kind) {
            case "A": return new Apple();
            case "B": return new Banana();
            case "G": return new FruitBox(); // G表示礼盒
            default: return null;
        }
    }
}